#ifndef __PRIMITIVE_RENDERER__
#define __PRIMITIVE_RENDERER__

#include "primitive.h"
#include <GL/glew.h>

class PrimitiveRenderer {
public:
	PrimitiveRenderer(Primitive* primitive) {
		this->primitive = primitive;
	}
	PrimitiveRenderer() {

	}
	virtual ~PrimitiveRenderer() {};
	virtual void Init() = 0;
	virtual void Update() {}
	virtual void Render() const = 0;
	Primitive* GetPrimitive() const { return primitive;}

	static std::string ColorString(size_t i) {return color[i].first;}
	static const Vec3n& Color(size_t i) {return color[i].second;}
	static size_t NumColors() {return color.size();}
	static size_t& CurrentColor() {return currentColor;}

	static std::vector< std::pair<std::string, Vec3n> > GenColorTable();
	
	bool& Visible();
	const bool& Visible() const;
protected:
	Primitive* primitive;
	static std::vector< std::pair<std::string, Vec3n> > color;
	static size_t currentColor;
};

#endif //__PRIMITIVE_RENDERER__

